/**
 * Created by AllanXu on 01/03/2016.
 */
define(function (require) {
	var Vue = require('vue'),
		Config = require('config'),
		_ = require('ajax'),
		utilities = require('utilities');

	var app = new Vue({
		el: '#uc_blacklist',
		data: {
			renderObj: {},
			picServer: Config.picServer
		},
		methods: {
			init: function () {
				_(Config.SERVICE.USERCENTER.BLACK_LIST, {
					id: sessionStorage.id
				}, function (data) {
					app.renderObj = data.pageitems;
				});
			},
			go: function (url) {
				location.href = url;
			},
			// 拉黑
			remove: function (id) {
				confirm('确认将该用户移除黑名单？');
				if (confirm) {
					_(Config.SERVICE.USERCENTER.BLACK_DEL, {
						'blackList.basicA.id': sessionStorage.id,
						'blackList.basicB.id': id
					}, function (data) {
						if (data.type === 'SUCCESS') {
							app.init();
						}
					});
				}
			}
		}
	});
	app.init();
});
